$OpenBSD: patch-Source_cmComputeLinkInformation_cxx,v 1.12 2015/03/26 07:10:02 dcoppa Exp $
--- Source/cmComputeLinkInformation.cxx.orig	Tue Mar 10 09:38:44 2015
+++ Source/cmComputeLinkInformation.cxx	Wed Mar 18 06:24:00 2015
@@ -667,10 +667,19 @@ void cmComputeLinkInformation::AddItem(std::string con
         }
       else
         {
-        // Use the full path given to the library file.
         this->Depends.push_back(item);
-        this->AddFullItem(item);
-        this->AddLibraryRuntimeInfo(item);
+        if(!this->OpenBSD)
+          {
+          // Use the full path given to the library file.
+          this->AddFullItem(item);
+          this->AddLibraryRuntimeInfo(item);
+          }
+        else
+          {
+          std::string file = cmSystemTools::GetFilenameName(item);
+          this->AddUserItem(file, false);
+          this->OrderLinkerSearchPath->AddLinkLibrary(item);
+          }
         }
       }
     else
@@ -1064,12 +1073,21 @@ void cmComputeLinkInformation::AddTargetItem(std::stri
     this->SharedLibrariesLinked.insert(target);
     }
 
-  // Handle case of an imported shared library with no soname.
-  if(this->NoSONameUsesPath &&
-     target->IsImportedSharedLibWithoutSOName(this->Config))
+  if(this->OpenBSD)
     {
-    this->AddSharedLibNoSOName(item);
-    return;
+    if(target->GetType() == cmTarget::SHARED_LIBRARY)
+      {
+      this->AddSharedLibNoSOName(item);
+      return;
+      }
+    } else {
+    // Handle case of an imported shared library with no soname.
+    if(this->NoSONameUsesPath &&
+       target->IsImportedSharedLibWithoutSOName(this->Config))
+      {
+      this->AddSharedLibNoSOName(item);
+      return;
+      }
     }
 
   // If this platform wants a flag before the full path, add it.
